# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ophcrack
pkgver=3.8.0
pkgrel=6
pkgdesc='Windows password cracker based on rainbow tables.'
groups=('blackarch' 'blackarch-cracker' 'blackarch-windows')
arch=('x86_64' 'aarch64')
url="http://ophcrack.sourceforge.net"
license=('GPL')
depends=('qt5-charts')
source=("https://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.bz2"
        'ophcrack.desktop')
sha512sums=('c66276b72299744d3e0c9fc14220c7f568e383bd324c1ede228bda5d51da78db817388421c9f5f8cd2f18687e7e53cfb0c65bcc0354b3d55ac16324c61f62dbd'
            'f2eb625262e9409261c1dd28a7ed334529dc082a7100ba095a9b2e5cffb5ef153d8ef2ebbe3be66d47070ab024ff20c63487147be9d8e285671a5a0ad4f6a9cd')

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/usr --enable-gui --enable-graph

  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  install -Dm 644 "$srcdir/$pkgname.desktop" \
    "$pkgdir"/usr/share/applications/ophcrack.desktop
  install -Dm 644 src/gui/pixmaps/os.xpm \
    "$pkgdir/usr/share/$pkgname/pixmaps/os.xpm"
}

